s = 'helloworldhelloworldhelloworldhelloworldasdf'
# # 1.字符串的拼接及not in
# s2 = ''
# for item in s:
#     if item not in s2:
#         s2 += item  # 拼接操作
# print(s2)
#
# # 2.使用索引 和  not in
# s2 = ''
# for i in range(len(s)):
#     if s[i] not in s2:
#         s2 += s[i]
# print(s2)

# 3 通过集合去重 + 列表排序
s3 = set(s)
print(s3)
lst = list(s3)
print(lst)
lst.sort(key=s.index)
print(''.join(lst))